package structural.flyweight;

/**
 * @ClassName: MainTest
 * @Description: 测试类
 * @Author: liu-hao
 * @Date: 2023-04-09 20:36
 * @Version: 1.0
 **/
public class MainTest {
    public static void main(String[] args) {
        FlyweightFactory factory = new FlyweightFactory();
        Flyweight flyweight1 = factory.getFlyweight("key1");
        Flyweight flyweight2 = factory.getFlyweight("key2");
        Flyweight flyweight3 = factory.getFlyweight("key1");

        flyweight1.operation();
        flyweight2.operation();
        flyweight3.operation();
    }
}
